﻿using System;

namespace KuiHuaBaoDian.Services.UGUI.Toggle {

    /// <summary>
    /// 开关组元素
    /// </summary>
    public class ToggleData<TData> : ToggleData {

        /// <summary>
        /// 自定义数据
        /// </summary>
        public new TData Data {
            get {
                return (TData)base.Data;
            }
            init {
                base.Data = value;
            }
        }
    }

    /// <summary>
    /// 开关组元素
    /// </summary>
    public class ToggleData : KHBD_Object {

        private IText m_Text;
        private object m_Data;

        /// <summary>
        /// 文本
        /// </summary>
        public IText Text {
            get => m_Text;
            init => m_Text = value;
        }

        /// <summary>
        /// 自定义数据
        /// </summary>
        public object Data {
            get => m_Data;
            init => m_Data = value;
        }

        protected override void Dispose() {
            m_Text = null;
            m_Data = null;
        }
    }
}
